home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 6592 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  954 b 

  1. Path: noc.tor.hookup.net!news
  2. From: Rajendra_Singh@msn.com (Rajendra Singh)
  3. Newsgroups: comp.lang.c,comp.lang.c++
  4. Subject: Re: How to the size of a file in C ?
  5. Date: Sat, 10 Feb 1996 02:12:59 GMT
  6. Organization: HookUp Communication Corporation, Oakville, Ontario, CANADA
  7. Message-ID: <4fgjs3$lt2@noc.tor.hookup.net>
  8. References: <4ffeqa$pjh@brtph500.bnr.ca>
  9. NNTP-Posting-Host: u36u400.tor.hookup.net
  10. NNTP-Posting-User: u36u400
  11. X-Newsreader: Forte Free Agent 1.0.82
  12.  
  13. Gilbert Banks <gilbertb@bnr.ca> wrote:
  14.  
  15. >How do I get the size of a file in C UNIX-based?  I tried sizeof <file>, but 
  16. >that only returns the size of the object called "<file>" and not the data.
  17. >I know about filelength(), also, but that is DOS, Windows, and OS/2.
  18.  
  19. Open the file and use lseek() with the SEEK_END constant as the
  20. origin.  lseek() will return the number of bytes.
  21. ---
  22. Rajendra Singh, B. Sc. (Rajendra_Singh@msn.com)
  23. "What is understood need not be discussed." - Loren Adams
  24.  
  25.